
import 'package:cbec_app/entity/home/content/content_data.dart';

class SeckillData extends ContentData {
  final String activityName;
  final int moreBtnStyle;
  final String displayScale;
  final String imageFillStyle;
  final String title;
  final String textAlignType;
  final String uuid;
  final String topBgColor;
  final String activityNameColor;
  final String textStyleType;
  final String price;
  final String showStockNum;
  final String moreBtnColor;
  final List<dynamic> subEntry; // Update the type as needed
  final int pageMargin;
  final String countdownBgColor;
  final String sizeType;
  final String showCountDown;
  final String moreBtnText;
  final String automatic;
  final String borderRadiusType;
  final int goodsMargin;
  final String showSoldNum;
  final String moreShow;
  final String size;
  final String originPrice;

  SeckillData({
    required this.activityName,
    required this.moreBtnStyle,
    required this.displayScale,
    required this.imageFillStyle,
    required this.title,
    required this.textAlignType,
    required this.uuid,
    required this.topBgColor,
    required this.activityNameColor,
    required this.textStyleType,
    required this.price,
    required this.showStockNum,
    required this.moreBtnColor,
    required this.subEntry,
    required this.pageMargin,
    required this.countdownBgColor,
    required this.sizeType,
    required this.showCountDown,
    required this.moreBtnText,
    required this.automatic,
    required this.borderRadiusType,
    required this.goodsMargin,
    required this.showSoldNum,
    required this.moreShow,
    required this.size,
    required this.originPrice,
  }) {
    type = "ump_seckill"; // Set the type based on your data
  }

  
  factory SeckillData.fromJson(Map<String, dynamic> json){
    return SeckillData(
      activityName: json['activity_name'],
      moreBtnStyle: json['more_btn_style'],
      displayScale: json['display_scale'],
      imageFillStyle: json['image_fill_style'],
      title: json['title'],
      textAlignType: json['text_align_type'],
      uuid: json['uuid'],
      topBgColor: json['top_bg_color'],
      activityNameColor: json['activity_name_color'],
      textStyleType: json['text_style_type'],
      price: json['price'],
      showStockNum: json['show_stock_num'],
      moreBtnColor: json['more_btn_color'],
      subEntry: json['sub_entry'],
      pageMargin: json['page_margin'],
      countdownBgColor: json['countdown_bg_color'],
      sizeType: json['size_type'],
      showCountDown: json['show_count_down'],
      moreBtnText: json['more_btn_text'],
      automatic: json['automatic'],
      borderRadiusType: json['border_radius_type'],
      goodsMargin: json['goods_margin'],
      showSoldNum: json['show_sold_num'],
      moreShow: json['more_show'],
      size: json['size'],
      originPrice: json['origin_price'],
    );
  }

   @override
  ContentData fromJson(Map<String, dynamic> json) {
    return SeckillData.fromJson(json);
  }

  @override
  Map<String, dynamic> toJson() {
    return {
      'activity_name': activityName,
      'more_btn_style': moreBtnStyle,
      'display_scale': displayScale,
      'image_fill_style': imageFillStyle,
      'title': title,
      'text_align_type': textAlignType,
      'uuid': uuid,
      'top_bg_color': topBgColor,
      'activity_name_color': activityNameColor,
      'text_style_type': textStyleType,
      'price': price,
      'show_stock_num': showStockNum,
      'more_btn_color': moreBtnColor,
      'sub_entry': subEntry,
      'page_margin': pageMargin,
      'countdown_bg_color': countdownBgColor,
      'size_type': sizeType,
      'show_count_down': showCountDown,
      'more_btn_text': moreBtnText,
      'automatic': automatic,
      'border_radius_type': borderRadiusType,
      'goods_margin': goodsMargin,
      'show_sold_num': showSoldNum,
      'more_show': moreShow,
      'size': size,
      'origin_price': originPrice,
    };
  }
}
